package com.mm.cloud.feign.sys.api.service;

import com.mm.cloud.common.core.constant.SecurityConstants;
import com.mm.cloud.common.core.constant.ServerModuleConstant;
import com.mm.cloud.common.core.result.Result;
import com.mm.cloud.feign.sys.api.vo.LoginUserVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;

/**
 * 用户服务
 *
 * @author mr
 * @since 2023-03-30
 */
@FeignClient(name = ServerModuleConstant.MM_SYS)
public interface IUserFeignService {

    /**
     * 查询用户
     *
     * @param username
     * @param source
     * @return
     */
    @PostMapping("/feign/api/sys/user/getUserByUsername/{username}")
    Result<LoginUserVO> getUserByUsername(@PathVariable("username") String username, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 查询用户
     *
     * @param phone
     * @param source
     * @return
     */
    @PostMapping("/feign/api/sys/user/getUserByPhone/{phone}")
    Result<LoginUserVO> getUserByPhone(@PathVariable("phone") String phone, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

}
